<?php
/**
 * Created by PhpStorm.
 * User: zd
 * Date: 2018/8/10
 * Time: 15:13
 */

namespace app\api\validate;


use think\Validate;

class IDMustBePositiveInt extends BaseValidate
{
    /**
     * 验证规则
     * @var array
     */
    protected $rule = [
      'id'=>'require|isPositiveInt'
    ];

    protected  $message = [
        'id'=>'ID必须是正整数'
    ];

    protected function isPositiveInt($value, $rule = '', $data = '', $field = '')
    {
        return parent::isPositiveInt($value, $rule, $data, $field); // TODO: Change the autogenerated stub
    }
}